package cn.zhaozhiqi.service.impl;

import cn.zhaozhiqi.mapper.CustomerWalletMapper;
import cn.zhaozhiqi.pojo.domain.CustomerWallet;
import cn.zhaozhiqi.service.ICustomerWalletService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 乘客的钱包 服务实现类
 * </p>
 *
 * @author zhaozhiqi
 * @since 2024-12-21
 */
@Service
public class CustomerWalletServiceImpl extends ServiceImpl<CustomerWalletMapper, CustomerWallet> implements ICustomerWalletService {

    @Override
    public void create(long customerId) {
        CustomerWallet customerWallet = new CustomerWallet();
        customerWallet.setId(customerId);
        customerWallet.setAmount(BigDecimal.ZERO);
        customerWallet.setCreateTime(new Date());
        customerWallet.setTotalRecharge(BigDecimal.ZERO);
        customerWallet.setTotalWithdraw(BigDecimal.ZERO);
        super.save(customerWallet);

    }
}
